package cn.wolfcode.rbac.util;

import org.springframework.util.StringUtils;

import java.lang.reflect.Method;

public class PermissionUtil {
    // 根据 method 生成权限表达式
    public static String handlerExpression(Method method){

        String simpleName = method.getDeclaringClass().getClass().getSimpleName().replace("Controller","");
        String expression = StringUtils.uncapitalize(simpleName) + ":" + method.getName();

        return expression;
    }
}
